/*
 * @Descripttion: 
 * @Author: MajorMayer
 * @Date: 2020-10-13 16:27:49
 * @LastEditors: 周杨
 * @LastEditTime: 2021-09-29 16:41:38
 */
import { forOwn } from 'lodash'

import { ipAddress } from "./apiIp"

const apis = {
    Common: {
        //第三方支付
        UWCPay: ['/UWCPay', 'POSTJSON'],
        //留言开关
        CreateMessageOnOrOff: ['/CreateMessageOnOrOff', 'POSTJSON'],
        //判断是否可以预约
        IsUserScheduleTourSignedUp: ['/IsUserScheduleTourSignedUp', 'POSTJSON'],
    }
}

const apisFactory = () => {
    let _apis = {}
    forOwn(apis, function (module, prefix) {
        forOwn(module, function ([uri, method, ...moreArgs], key) {
            _apis[key] = [ipAddress + '/Api/' + prefix + uri, method, moreArgs]
        })
    })
    return _apis
}

export default apisFactory()